Feat/cohort retention 863 - #1102
Open
Robinsonchiziterem wants to merge 3 commits into
Open
Robinsonchiziterem wants to merge 3 commits into
Robinsonchiziterem wants to merge 3 commits into
Conversation
|
@Robinsonchiziterem is attempting to deploy a commit to the nanle-code's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Robinsonchiziterem Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Collaborator
|
@Robinsonchiziterem Please resolve conflicts. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#863 [2026 Analytics] Add cohort retention views for account activity
Summary
Resolves #863 by adding Cohort Retention Views for Account Activity to the Analytics workspace in
stellar-dev-dashboard.Adds cohort retention views for Stellar account activity to the Analytics dashboard (#863). Accounts are grouped by their first-seen period (Day, Week, Month) and subsequent retention decay rates are tracked across subsequent time periods.
This PR provides cohort matrix heatmaps and retention curve visualizations that group accounts by their first-seen period (Day, Week, or Month) and analyze subsequent retention over time.
src/lib/cohortRetention.ts): Pure TypeScript calculation engine for cohort matrices, summary statistics, period headers, activity filtering (Payments, Smart Contracts, DEX Trades), CSV/JSON exports, and discriminated union error handling (CohortRetentionResult).src/components/dashboard/CohortRetentionView.tsx): Heatmap matrix table with HSL-tailored dark mode color gradients, Recharts line chart for average retention curve, granularity controls, view mode toggles (%vs#), and export buttons.Analytics.tsxand registered route/cohortRetentioninroutes.ts.docs/features/COHORT_RETENTION_ANALYTICS.mdand changelog entry inCHANGELOG.md.Closes #863
Ran unit and component tests:
pnpm run test:unit -- src/lib/__tests__/cohortRetention.test.ts src/components/dashboard/__tests__/CohortRetentionView.test.tsx(20 passed)2. React UI Component (
src/components/dashboard/CohortRetentionView.tsx):Daily,Weekly,Monthly).Percentage %vsAccount Count #).minCohortSizefiltering.null/ non-array activity inputs, invalid granularity strings ('year'), negative period parameters, malformed records with invalid dates/missing IDs, calculation error objects, and graceful fallback whenURL.createObjectURLis unsupported in JSdom/SSR.CohortRetentionViewinsrc/components/dashboard/Analytics.tsx./cohortRetentionroute insrc/routes/routes.ts.Merge requirements
src/lib/__tests__/cohortRetention.test.ts(16 tests): Tests primary flows (weekly/daily/monthly cohorts), boundary cases (empty datasets, single activity, 0% & 100% retention, timestamp parsing), and failure paths (null inputs, invalid granularity, negative parameters, malformed records).src/components/dashboard/__tests__/CohortRetentionView.test.tsx(4 tests): Component tests validating UI rendering, controls, view mode toggles, and export triggers.A PR is merged only when every box below is true. See
Merge requirements for the full policy.
docs/features/COHORT_RETENTION_ANALYTICS.md: Complete guide covering architecture, features, compatibility, security, and migration/integration code snippets.CHANGELOG.md: Entry under## [Unreleased].masterif GitHub shows "This branch has conflicts").Acceptance Criteria Verification